import request from '@/utils/request'

// 查询购买绿证列表
export function listCertificate(query) {
  return request({
    url: '/green/certificate/list',
    method: 'get',
    params: query
  })
}

// 查询购买绿证详细
export function getCertificate(id) {
  return request({
    url: '/green/certificate/' + id,
    method: 'get'
  })
}

// 新增购买绿证
export function addCertificate(data) {
  return request({
    url: '/green/certificate',
    method: 'post',
    data: data
  })
}

// 修改购买绿证
export function updateCertificate(data) {
  return request({
    url: '/green/certificate',
    method: 'put',
    data: data
  })
}

// 删除购买绿证
export function delCertificate(id) {
  return request({
    url: '/green/certificate/' + id,
    method: 'delete'
  })
}

// 导出购买绿证
export function exportCertificate(query) {
  return request({
    url: '/green/certificate/export',
    method: 'get',
    params: query
  })
}

// 保存上传数据
export function changeData(data) {
  return request({
    url: '/green/certificate/changeData',
    method: 'post',
    data: data
  })
}
